I have a problem with my Consts.hpp file:
#pragma once
#include <stdafx.h>
namespace consts {
const GLchar* TEXTURE_DIR = "../../blabla/"; // doesn't work
const GLchar TEXTURE_DIR[14] = "../../blabla/"; // works
};
This file is added to the stdafx.h file. ColladaReader.cpp is the file where I access TEXTURE_DIR.
Why does the pointer not work in the namespace? When accessing the constant I get this error:
Error 5 error LNK2005: "char const * const consts::TEXTURE_DIR" (?TEXTURE_DIR@consts@@3PBDB) already defined in ColladaReader.obj D:\Privat\code\openglearn\projects\ColladaReader\stdafx.obj